import React from 'react'
import { HashRouter as Router, Route, Switch } from 'react-router-dom'
import Main from './main'
import About from './about'
import BookList from './booklist'
import FoodList from './foodlist'
import Topic from './topic'
import Home from './Home'

export default class IRouter extends React.Component{
  render() {
    return (
      <Router>
        <Home>
          <Route path="/" render={() => 
            <Main>
              <Switch>
                <Route exact={true} path="/home/book" component={BookList}></Route>
                <Route path="/home/food" component={FoodList}></Route>
              </Switch>
            </Main>
          }></Route>
          <Route path="/about" component={About}></Route>
          <Route path="/topic" component={Topic}></Route>
        </Home>
      </Router>
    )
  }
}